#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QUdpSocket>
#include <QMovie>
#include <QTextToSpeech>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

private:
    QTextToSpeech *speech;//语音

private:
    double currentThreshold = 0.0;

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private slots:
    void on_pushButton_5_clicked();
    void on_pushButton_clicked();
    void on_pushButton_2_clicked();
    void readPendingDatagrams();

private:
    Ui::Widget *ui;
    QUdpSocket *udp;
    QMovie *movie;
    bool isManualCooling = false;
    bool isAutoCooling = false;

    void sendCommand(const QString &command);
};
#endif // WIDGET_H
